package com.aspose.cells;

import java.util.ArrayList;

class zlv {
   private zhh a;
   private ArrayList b = new ArrayList();
   private ArrayList c = new ArrayList();
   private ArrayList d = new ArrayList();
   private ArrayList e = new ArrayList();
   private ArrayList f = new ArrayList();
   private ArrayList g = new ArrayList();
   private ArrayList h = new ArrayList();
   private ArrayList i = new ArrayList();
   private ArrayList j = new ArrayList();
   private ArrayList k = new ArrayList();
   private int l = 0;
   private int m = 0;
   private int n = 0;
   private StringBuilder o;
   private StringBuilder p;

   public zlv(zhh var1, StringBuilder var2, StringBuilder var3) {
      this.a = var1;
      this.o = var2;
      this.p = var3;
   }

   public void a() {
      if (this.o.length() >= 1) {
         zht var1 = new zht(this.a, com.aspose.cells.b.a.zr.a(this.o));
         this.o.setLength(0);
         this.m += var1.d();
         if (var1.c() != null) {
            int[] var2 = var1.c();
            int var3 = var2.length;

            for(int var4 = 0; var4 < var3; ++var4) {
               int var5 = var2[var4];
               com.aspose.cells.b.a.a.ze.a(this.i, (Object)var5);
            }
         }

         com.aspose.cells.b.a.a.ze.a(this.f, (Object)var1);
         com.aspose.cells.b.a.a.ze.a(this.g, (Object)this.p.length());
      }
   }

   public void a(boolean var1, int var2) {
      this.a();
      com.aspose.cells.b.a.a.ze.a(this.e, (Object)var1);
      com.aspose.cells.b.a.a.ze.a(this.d, (Object)this.m);
      this.l += this.m;
      this.m = 0;
      com.aspose.cells.b.a.a.ze.a(this.h, (Object)this.i.size());
      int var5;
      if (this.f.size() > 0) {
         zht[] var3 = new zht[this.f.size()];
         int[] var4 = new int[var3.length];

         for(var5 = 0; var5 < var3.length; ++var5) {
            var3[var5] = (zht)this.f.get(var5);
            var4[var5] = var1 ? var2 - (Integer)this.g.get(var5) : (Integer)this.g.get(var5) - var2;
         }

         if (var1) {
            if (var4[0] == var2 - this.n) {
               var4[0] = Integer.MAX_VALUE;
            }
         } else if (var4[var4.length - 1] == this.p.length() - var2) {
            var4[var4.length - 1] = Integer.MAX_VALUE;
         }

         com.aspose.cells.b.a.a.ze.a(this.b, (Object)var3);
         com.aspose.cells.b.a.a.ze.a(this.c, (Object)var4);
         this.f.clear();
         this.g.clear();
      } else {
         com.aspose.cells.b.a.a.ze.a(this.b, (Object)null);
         com.aspose.cells.b.a.a.ze.a(this.c, (Object)null);
      }

      if (this.k.size() > 0) {
         int[] var6 = new int[this.k.size()];

         for(var5 = 0; var5 < var6.length; ++var5) {
            int var7 = (Integer)this.k.get(var5);
            if (var7 < 0) {
               var7 = -var7 - 1;
               var7 = var1 ? var2 - var7 - 1 : var7 - var2;
               var7 = -var7 - 1;
            } else {
               var7 = var1 ? var2 - var7 - 1 : var7 - var2;
            }

            var6[var5] = var7;
         }

         this.k.clear();
         com.aspose.cells.b.a.a.ze.a(this.j, (Object)var6);
      } else {
         com.aspose.cells.b.a.a.ze.a(this.j, (Object)null);
      }

      this.n = this.p.length();
   }

   public void a(boolean var1) {
      if (var1) {
         com.aspose.cells.b.a.a.ze.a(this.k, (Object)this.p.length());
      } else {
         com.aspose.cells.b.a.a.ze.a(this.k, (Object)(-this.p.length() - 1));
      }

   }

   public StringBuilder b() {
      return this.o;
   }

   public StringBuilder c() {
      return this.p;
   }

   public int d() {
      return this.l;
   }

   public zht[][] e() {
      if (this.b.size() > 0) {
         zht[][] var1 = new zht[this.b.size()][];

         for(int var2 = 0; var2 < var1.length; ++var2) {
            if (this.b.get(var2) != null) {
               var1[var2] = (zht[])((zht[])this.b.get(var2));
            }
         }

         return var1;
      } else {
         return (zht[][])null;
      }
   }

   public int[][] f() {
      if (this.b.size() > 0) {
         int[][] var1 = new int[this.c.size()][];

         for(int var2 = 0; var2 < var1.length; ++var2) {
            if (this.c.get(var2) != null) {
               var1[var2] = (int[])((int[])this.c.get(var2));
            }
         }

         return var1;
      } else {
         return (int[][])null;
      }
   }

   public int[] g() {
      if (this.b.size() <= 0) {
         return null;
      } else {
         int[] var1 = new int[this.d.size()];

         for(int var2 = 0; var2 < var1.length; ++var2) {
            var1[var2] = (Integer)this.d.get(var2);
         }

         return var1;
      }
   }

   public boolean[] h() {
      if (this.b.size() <= 0) {
         return null;
      } else {
         boolean[] var1 = new boolean[this.e.size()];

         for(int var2 = 0; var2 < var1.length; ++var2) {
            var1[var2] = (Boolean)this.e.get(var2);
         }

         return var1;
      }
   }

   public int[] i() {
      if (this.i.size() <= 0) {
         return null;
      } else {
         int[] var1 = new int[this.i.size()];

         for(int var2 = 0; var2 < var1.length; ++var2) {
            var1[var2] = (Integer)this.i.get(var2);
         }

         return var1;
      }
   }

   public int[] j() {
      if (this.i.size() <= 0) {
         return null;
      } else {
         int[] var1 = new int[this.h.size()];

         for(int var2 = 0; var2 < var1.length; ++var2) {
            var1[var2] = (Integer)this.h.get(var2);
         }

         return var1;
      }
   }

   public int[][] k() {
      if (this.j.size() > 0) {
         int[][] var1 = new int[this.j.size()][];

         for(int var2 = 0; var2 < var1.length; ++var2) {
            if (this.j.get(var2) != null) {
               var1[var2] = (int[])((int[])this.j.get(var2));
            }
         }

         return var1;
      } else {
         return (int[][])null;
      }
   }
}
